From e631d2d2d45286a2b50ca82b3c12a963583d9e4e Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 29 Jan 2009 17:36:17 +0100 Subject: [PATCH] Sync the display when creating a native window. This is needed because we want to be able to use the xid immediately even from another process or another connection to the display. --- gdk/gdkwindow.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index 102fc903e7..b4428651ef 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -1305,6 +1305,12 @@ gdk_window_set_has_native (GdkWindow *window, gboolean has_native) if (gdk_window_is_viewable (window)) GDK_WINDOW_IMPL_GET_IFACE (private->impl)->show (window); + + /* We sync here to ensure the window is created in the Xserver when + * this function returns. This is required because the returned XID + * for this window must be valid immediately, even with another + * connection to the Xserver */ + gdk_display_sync (gdk_drawable_get_display (window)); } else { -- 2.30.2